#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<assert.h>
#include<math.h>
void f(char arr[], char* x)
{
	char* left = arr;
	char* right = x - 1;
	while (left <= right)
	{
		char a = *left;
		*left = *right;
		*right = a;
		left += 1;
		right -= 1;
	}
}
int main()
{
	char arr[100] = { 0 };  //cin.  get
	scanf("%99[^\n]", arr);
	f(arr, arr+ strlen(arr));
	char* e = arr;
	char* w = arr;
	do
	{
		while (1)
		{
			e++;
			if (*e == ' '|| *e =='\0')
			{
				break;
			}
		}
		f(w, e);
		w = e+1;
	} while (*e != '\0');
	printf("%s", arr);
	return 0;
}